/**
 * @description 供应商档案
 * @author caorui
 * @Date 2022-10-01 09:00
 */
// 供应商列表表头数据
const supplierTableColumn = [
  {
    label: "所属公司",
    prop: "companyCount",
    tooltip: true,
    width: "80",
  },
  {
    label: "供应商编码",
    prop: "venCode",
    tooltip: true,
  },
  {
    label: "供应商名称",
    prop: "venName",
    tooltip: true,
  },
  {
    label: "供应商简称",
    prop: "venShortName",
    tooltip: true,
  },
  {
    label: "助记码",
    prop: "zujm",
    tooltip: true,
  },
  {
    label: "客户分类",
    prop: "cusClassifyName",
    tooltip: true,
  },
  {
    label: "分管部门",
    prop: "orgainName",
    tooltip: true,
  },
  {
    label: "法人",
    prop: "legalPerson",
    tooltip: true,
  },
  {
    label: "税号",
    prop: "taxNumber",
    tooltip: true,
  },
  {
    label: "电话",
    prop: "telphone",
    tooltip: true,
  },
  {
    label: "省",
    prop: "province",
    tooltip: true,
  },
  {
    label: "市",
    prop: "city",
    tooltip: true,
  },
  {
    label: "县",
    prop: "conty",
    tooltip: true,
  },
  {
    label: "详细地址",
    prop: "address",
    tooltip: true,
  },
];
// 供应商新增表单
const supplierFormList = [
  {
    elCol: [
      {
        label: "供应商编码",
        prop: "venCode",
        tag: "elInput",
        span: 8,
      },
      {
        label: "供应商名称",
        prop: "venName",
        tag: "elInput",
        span: 8,
      },
      {
        label: "供应商简称",
        prop: "venShortName",
        tag: "elInput",
        span: 8,
      },
    ],
  },
  {
    elCol: [
      {
        label: "助记码",
        prop: "zujm",
        tag: "elInput",
        span: 8,
      },
      {
        label: "客户分类",
        prop: "cusClassifyName",
        disabled: true,
        tag: "elInput",
        span: 8,
      },
      {
        label: "分管部门",
        prop: "orgainName",
        tag: "elDialog",
        span: 8,
      },
    ],
  },
  {
    elCol: [
      {
        label: "法人",
        prop: "legalPerson",
        tag: "elInput",
        span: 8,
      },
      {
        label: "税号",
        prop: "taxNumber",
        tag: "elInput",
        span: 8,
      },
      {
        label: "电话",
        prop: "telphone",
        tag: "elInput",
        span: 8,
      },
    ],
  },
  {
    elCol: [
      {
        label: "省",
        prop: "province",
        tag: "elSelect",
        options: [],
        span: 8,
      },
      {
        label: "市",
        prop: "city",
        tag: "elSelect",
        options: [],
        span: 8,
      },
      {
        label: "县",
        prop: "county",
        tag: "elSelect",
        options: [],
        span: 8,
      },
    ],
  },
  {
    elCol: [
      {
        label: "详细地址",
        prop: "address",
        tag: "elInput",
        span: 24,
      },
    ],
  },
];
// 供应商新增表头数据
const supplierAddColumn = [
  {
    label: "序号",
    prop: "index",
    tooltip: true,
    width: "80",
  },
  {
    label: "姓名",
    prop: "linkName",
    tooltip: true,
  },
  {
    label: "手机号",
    prop: "mobile",
    tooltip: true,
  },
  {
    label: "电话",
    prop: "telphone",
    tooltip: true,
  },
  {
    label: "邮箱",
    prop: "Email",
    tooltip: true,
  },
  {
    label: "职务",
    prop: "duty",
    tooltip: true,
  },
  {
    label: "是否默认联系人",
    prop: "isdefault",
    tooltip: true,
  },
  {
    label: "行号",
    prop: "rowIndex",
    tooltip: true,
  },
];

// 表单校验
const rules = {
  venCode: [
    {
      required: true,
      message: "请输入供应商编码",
      trigger: "blur",
    },
  ],
  venName: [
    {
      required: true,
      message: "请输入供应商名称",
      trigger: "blur",
    },
  ],
  orgainName: [
    {
      required: true,
      message: "请选择分管部门",
      trigger: "blur",
    },
  ],
};
const treeDialogRules = {
  code: [
    {
      required: true,
      message: "请输入分类编码",
      trigger: "blur",
    },
  ],
  name: [
    {
      required: true,
      message: "请输入分类名称",
      trigger: "blur",
    },
  ],
  sort: [
    {
      required: true,
      message: "请输入数字",
      trigger: "blur",
    },
    // { type: "number", message: "请输入有效的数字", trigger: "blur" },
  ],
};

// 查看
const showFormColumn = [
  {
    elCol: [
      {
        label: "供应商编码",
        prop: "venCode",
      },
      {
        label: "供应商名称",
        prop: "venName",
      },
      {
        label: "供应商简称",
        prop: "venShortName",
      },
    ],
  },
  {
    elCol: [
      {
        label: "助记码",
        prop: "zujm",
      },
      {
        label: "客户分类",
        prop: "venClassifyName",
      },
      {
        label: "分管部门",
        prop: "orgainName",
      },
    ],
  },
  {
    elCol: [
      {
        label: "法人",
        prop: "legalPerson",
      },
      {
        label: "税号",
        prop: "taxNumber",
      },
      {
        label: "电话",
        prop: "telphone",
      },
    ],
  },
  {
    elCol: [
      {
        label: "省",
        prop: "provinceName",
      },
      {
        label: "市",
        prop: "cityName",
      },
      {
        label: "县",
        prop: "countyName",
      },
    ],
  },
  {
    elCol: [
      {
        label: "详细地址",
        prop: "address",
        span: 24,
      },
    ],
  },
];
const enclosureTableColumn = [
  {
    label: "序号",
    prop: "index",
    tooltip: true,
    width: "80",
  },
  {
    label: "文件名",
    prop: "sa_ShowName",
    tooltip: true,
  },
  {
    label: "上传人",
    prop: "personName",
    tooltip: true,
    width: "160",
  },
  {
    label: "上传时间",
    prop: "sa_UploadDateTime",
    tooltip: true,
    width: "160",
  },
  {
    label: "文件大小(kb)",
    prop: "sa_AttachmentSize",
    tooltip: true,
    width: "160",
  },
];
// 组织机构树表单
const treeFormData = [
  {
    elCol: [
      {
        label: "分类编码",
        prop: "code",
        tag: "elInput",
        span: 12,
      },
      {
        label: "分类名称",
        prop: "name",
        tag: "elInput",
        span: 12,
      },
    ],
  },
  {
    elCol: [
      {
        label: "顺序",
        prop: "sort",
        tag: "elInput",
        span: 12,
        rulesName: "integer",
        type: "number",
      },

      {
        label: "上级分类",
        prop: "codename",
        tag: "elInput",
        disabled: true,
        span: 12,
      },
    ],
  },
  {
    elCol: [
      {
        label: "备注",
        prop: "remark",
        tag: "elInput",
        span: 24,
      },
    ],
  },
];
export default {
  supplierTableColumn, //供应商列表表头数据
  supplierFormList, //供应商新增表单
  supplierAddColumn,
  showFormColumn,
  enclosureTableColumn,
  treeFormData,
  rules,
  treeDialogRules,
};
